package day01;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;

public class SystemInserDemo01 {
    public static void main(String[] args) throws FileNotFoundException {
        //对标准的键盘输入流进行重定向
        System.setIn(new FileInputStream(new File("D:\\1\\ObjectTest.java")));
        Scanner sc = new Scanner(System.in);
        String message = null;
        System.setOut(new PrintStream(new File("D:\\1\\out.java")));
        while((message=sc.nextLine())!=null) {
            System.out.println(message);
        }

    }
}
